import type { PlanConfigVO, PlanConfigForm, PlanConfigQuery } from './model';

import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';

import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

/**
* 查询提醒任务配置列表
* @param params
* @returns 提醒任务配置列表
*/
export function planConfigList(params?: PlanConfigQuery) {
  return requestClient.get<PageResult<PlanConfigVO>>('/business/reminderConfig/list', { params });
}

/**
 * 导出提醒任务配置列表
 * @param params
 * @returns 提醒任务配置列表
 */
export function planConfigExport(params?: PlanConfigQuery) {
  return commonExport('/business/reminderConfig/export', params ?? {});
}

/**
 * 查询提醒任务配置详情
 * @param id id
 * @returns 提醒任务配置详情
 */
export function planConfigInfo(id: ID) {
  return requestClient.get<PlanConfigVO>(`/business/reminderConfig/${id}`);
}

/**
 * 新增提醒任务配置
 * @param data
 * @returns void
 */
export function planConfigAdd(data: PlanConfigForm) {
  return requestClient.postWithMsg<string>('/business/reminderConfig', data);
}

/**
 * 更新提醒任务配置
 * @param data
 * @returns void
 */
export function planConfigUpdate(data: PlanConfigForm) {
  return requestClient.putWithMsg<void>('/business/reminderConfig', data);
}

/**
 * 删除提醒任务配置
 * @param id id
 * @returns void
 */
export function planConfigRemove(id: ID | IDS) {
  return requestClient.deleteWithMsg<void>(`/business/reminderConfig/${id}`);
}
